Currently, buttons are created only within the XCMD itself. The number of buttons created is specified by the constant 'NUMBER_OF_BUTTONS'. When NewRgn is called, it performs a loop from 1 to the number of buttons you have specified. Within the loop, it makes a call to the routine:
FUNCTION NewButton(ButtonNum:integer):RgnHandle;
It is up to this routine to create the region of the button (based on the number of the button specified) and return it back to the main loop.